using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

using System.Diagnostics;

namespace amazingfishing.sprites
{
    public class wood : Sprite
    {
        //speed = new Vector2(1,0);
        public wood(Texture2D _img, Vector2 _position, Point _frameSize, Point _sheetSize, int _timeperFrame,Vector2 _speed)
            : base(_img, _position, _frameSize, _sheetSize, _timeperFrame)
        {
            speed = _speed;
        }

       
        
        public override void Update(GameTime gameTime)
        {
            position.X += speed.X;
           // Debug.WriteLine(speed.X);
           // Debug.WriteLine(position.X);
            if (position.X < 0 || position.X > 480 - frameSize.X)
                speed.X *= -1;
            if (position.Y < 0 || position.Y > 800 - frameSize.Y)
                speed.Y *= -1;
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
           
            base.Draw(gameTime, spriteBatch);
        }
        public override Rectangle CollisionRect()
        {
            Rectangle rect = new Rectangle((int)(position.X + 5), (int)(position.Y + 10),
                    (int)((frameSize.X - 10)), 30);
            return rect; 
            //return base.CollisionRect();
        }
       
    }
}
